/*
 * UIManager.cpp
 *
 *  Created on: 01-12-2010
 *      Author: Przemek
 */

#include "gui/UIManager.hpp"
using namespace std;

const string UIManager::DEFAULT_FONT = "resources/arial.glf";

const UIManager& UIManager::getInstance()
{
	static const UIManager singleton;

	return singleton;
}

UIManager::UIManager()
{
	GLuint textureId;
	glGenTextures(1, &textureId);
	font.load(DEFAULT_FONT, textureId);

	setColors();
}

void UIManager::setColors()
{
	buttonFrameColor.set(0, 60, 116);
	buttonInsideColor.set(242, 242, 237);
	buttonTextColor = GLColor::BLACK;

	spinnerBackgroundColor.set(242, 242, 237);
	spinnerTextColor = GLColor::BLACK;

	scrollBarTrackColor.set(127, 127, 127);

	sliderTrackColor.set(127, 127, 127);

	inputFieldBackgroundColor = GLColor::WHITE;
	inputFieldTextColor = GLColor::BLACK;

	tabbedPaneBackgroundColor = GLColor::BLACK;
	tabbedPaneTabColor.set(190, 190, 190);
	tabbedPaneTabTextColor = GLColor::WHITE;

	checkboxBackground = GLColor::WHITE;
	checkboxCheck = GLColor::BLACK;
}

const GLFont& UIManager::getGUIFont() const
{
	return font;
}

const GLColor UIManager::getButtonFrameColor() const
{
	return buttonFrameColor;
}

const GLColor UIManager::getButtonInsideColor() const
{
	return buttonInsideColor;
}

const GLColor UIManager::getButtonTextColor() const
{
	return buttonTextColor;
}

const GLColor UIManager::getSpinnerBackgroundColor() const
{
	return spinnerBackgroundColor;
}

const GLColor UIManager::getSpinnerTextColor() const
{
	return spinnerTextColor;
}

const GLColor UIManager::getScrollBarTrackColor() const
{
	return scrollBarTrackColor;
}

const GLColor UIManager::getSliderTrackColor() const
{
	return sliderTrackColor;
}

const GLColor UIManager::getInputFieldBackgroundColor() const
{
	return inputFieldBackgroundColor;
}

const GLColor UIManager::getInputFieldTextColor() const
{
	return inputFieldTextColor;
}

const GLColor UIManager::getTabbedPaneBackgroundColor() const
{
	return tabbedPaneBackgroundColor;
}

const GLColor UIManager::getTabbedPaneTabColor() const
{
	return tabbedPaneTabColor;
}

const GLColor UIManager::getTabbedPaneTabTextColor() const
{
	return tabbedPaneTabTextColor;
}

const GLColor UIManager::getCheckboxBackground() const
{
	return checkboxBackground;
}

const GLColor UIManager::getCheckboxCheck() const
{
	return checkboxCheck;
}
